/** <a href="http://www.cpupk.com/decompiler">Eclipse Class Decompiler</a> plugin, Copyright (c) 2017 Chen Chao. **/
package com.minierp.dao.hibernate;

import com.minierp.dao.CodeRuleDao;
import com.minierp.dao.hibernate.BaseDaoImpl;
import com.minierp.model.CodeRule;
import java.util.List;

public class CodeRuleDaoImpl extends BaseDaoImpl implements CodeRuleDao {
	public List getList() {
		String sql = "from com.minierp.model.CodeRule c where c.enabled=\'Y\' order by c.id";
		return this.getHibernateTemplate().find(sql);
	}

	public CodeRule get(String dataCode) {
		String[] paramNames = new String[]{"dataCode"};
		Object[] values = new Object[]{dataCode};
		List list = this.getHibernateTemplate().findByNamedParam(
				"from com.minierp.model.CodeRule c where c.dataCode=:dataCode",
				paramNames, values);
		return !list.isEmpty() ? (CodeRule) list.get(0) : null;
	}
}